var userInp = document.getElementById("user");

    var pwdInp = document.getElementById("pwd");

    var btn = document.getElementById("btn");

    btn.onclick = function () {
        // 用户输入的
        var user = userInp.value;
        var pwd = pwdInp.value;

        if (user && pwd) {
            login({user, pwd}).then(function (result) {
                var { status, detail } = result;
                if(status){
                    setCookie("lgc", user, 30);
                    location.href = "./index1.html";
                }
            }).catch(err=> {
                throw err;
            })
        }
    }